package day06test;

import java.util.Random;

public class Test03 {
    public static void main(String[] args) {
        //方法重载
        say();
        say("你好GG");
        say("米米",18);
        int[] arr=generateArray(10,10);
        System.out.println(arr.length);
        System.out.println(arr[0]);
        printArray(arr);
    }
    public static void say(){
        System.out.println("hello");
    }
    public static void say(String name){
        System.out.println("hello,"+name);
    }
    public static void say(String name,int age){
        System.out.println("hello"+name+age+"岁");
    }
    public static int[] generateArray(int t,int m){
        int[] arr=new int[t];
        Random random=new Random();
        for (int i=0;i<arr.length;i++){
            arr[i]=random.nextInt(m+1);
        }
        return arr;
    }
    public static void printArray(int[] array){
        for (int i=0;i<array.length;i++){
            System.out.print(array[i]+"\t");
        }
    }
}
